const { STATUS_CODES } = require('http')
module.exports = {
  json(err) {
    const error = err.originalError?.error || err.error || STATUS_CODES[err.status]
    const error_description = err.message
    const error_details = err.details
    this.body = { error, error_description, error_details }
  }
}